package com.boge.core.common;

import java.util.HashMap;
import java.util.Map;

public class AjaxResult {

	private boolean status = true;
	private String message = "请求成功";
	private Object data;
	
	public AjaxResult() {
	}
	
	public AjaxResult(boolean status) {
		super();
		this.status = status;
	}

	public AjaxResult(Object data) {
		super();
		this.data = data;
	}

	public AjaxResult(String message) {
		super();
		this.message = message;
	}

	public AjaxResult(boolean status, String message) {
		this.status = status;
		this.message = message;
	}

	public AjaxResult(String message, Object data) {
		super();
		this.message = message;
		this.data = data;
	}

	public AjaxResult(boolean status, String message, Object data) {
		super();
		this.status = status;
		this.message = message;
		this.data = data;
	}

	public boolean isStatus() {
		return status;
	}

	public void setStatus(boolean status) {
		this.status = status;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	@Override
	public String toString() {
		return "AjaxResult [status=" + status + ", message=" + message + ", data=" + data + "]";
	}

	public Map<String, Object> toMap() {
		Map<String, Object> map = new HashMap<>();
		map.put("status", status);
		map.put("msg", message);
		map.put("data", data);
		return map;
	}
	
}
